package com.sgb.kjwl.viewmodel.self;

import com.sgb.kjwl.model.entity.user.MessageEntity;
import com.sgb.kjwl.repository.SelfRepertory;
import com.sgb.kjwl.view.ui.activity.self.MessageActivity;
import com.swgk.core.base.BaseViewModel;
import com.swgk.core.util.DateUtils;

import java.util.ArrayList;
import java.util.List;

/**
 *
 */
public class MessageModel extends BaseViewModel {

    private MessageActivity activity;
    private SelfRepertory repertory;

    public MessageModel(MessageActivity activity, SelfRepertory repertory) {
        this.activity = activity;
        this.repertory = repertory;
    }

    public void getMessageList() {
        List<MessageEntity> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            MessageEntity messageEntity = new MessageEntity();
            messageEntity.setId(i + "");
            messageEntity.setContent("测试消息内容" + i);
            messageEntity.setTitle("测试消息标题" + i);
            messageEntity.setDate(DateUtils.stampToDate(String.valueOf(System.currentTimeMillis())));
            list.add(messageEntity);
        }
        activity.showMessage(list);
    }
}
